﻿using System;
using System.Collections.Generic;
using System.Linq;
using System.Text;
using FluentNHibernate.Mapping;
using NHibernate;
using FluentNHibernate.Data;

namespace BankCreditPortfolio.DAL.Entities
{
    public class PageTemplate
    {
        public virtual int PageTemplateId { get; set; }
        public virtual PageTemplate ParentPageTemplate { get; set; }
        public virtual string Name { get; set; }
    }

    public class PageTemplateMap : ClassMap<PageTemplate>
    {
        public PageTemplateMap()
        {
            Id(x => x.PageTemplateId).GeneratedBy.HiLo("pagetemplate");
            Id(x => x.PageTemplateId).Unique();
            References(x => x.ParentPageTemplate).Column("ParentPageTemplate");
            Map(x => x.Name);
            Table("PageTemplate");
        }
    }
}
